package com.dream.keigezhushou.Activity.acty.listen.local;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;
import android.widget.Toast;

import com.dream.keigezhushou.Activity.acty.listen.myadapter.SearchYourselfAdapter;
import com.dream.keigezhushou.Activity.wigdt.DividerItemDeoration;
import com.dream.keigezhushou.R;

import java.util.ArrayList;

import butterknife.BindView;
import butterknife.ButterKnife;

public class SearchYourselfActivity extends AppCompatActivity implements View.OnClickListener{
    @BindView(R.id.ib_return)
    ImageView ibReturn;
    @BindView(R.id.ib_search_localmusic)
    TextView ibSearchLocalmusic;
    @BindView(R.id.localmusic)
    TextView localmusic;
    @BindView(R.id.rl_ltitle)
    RelativeLayout rlLtitle;
    @BindView(R.id.rcv_yourself)
    RecyclerView rcvYourself;
    @BindView(R.id.tv_searchYourself)
    TextView tvSearchYourself;
    @BindView(R.id.l_search_buttom)
    RelativeLayout lSearchButtom;
    @BindView(R.id.activity_search_yourself)
    LinearLayout activitySearchYourself;
    private ArrayList<String> yourlist;
    private SearchYourselfAdapter searchyourselfadapter;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_search_yourself);
        ButterKnife.bind(this);


        setlisteners();
        intDatas();

        searchyourselfadapter = new SearchYourselfAdapter(SearchYourselfActivity.this, yourlist);
        rcvYourself.setAdapter(searchyourselfadapter);
        rcvYourself.setLayoutManager(new LinearLayoutManager(this));
        rcvYourself.addItemDecoration(new DividerItemDeoration(this, DividerItemDeoration.VERTICAL_LIST));
    }
    private void setlisteners() {
        ibReturn.setOnClickListener(this);
        ibSearchLocalmusic.setOnClickListener(this);
        lSearchButtom.setOnClickListener(this);
    }

    private void intDatas() {
        yourlist = new ArrayList<String>();
        for (int i = 1; i < 20; i++) {
            yourlist.add("" + i);
        }
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.ib_return:
                finish();
                break;
            case R.id.ib_search_localmusic:
                Toast.makeText(this, "全选", Toast.LENGTH_SHORT).show();
                break;
            case R.id.l_search_buttom:
                break;


        }


    }


}
